﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using BackupAssurance.Library.Interfaces;



namespace BackupAssurance.Library.ModelsDB
{
    public class pcJobAction : IVersionTracking, IpcIdentity
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long Id { get; set; }

        //IpcIdentity
        [Required]
        [MaxLength(75)]
        public string name { get; set; }
        [MaxLength(1000)]
        public string description { get; set; }
        [Required]
        [MaxLength(30)]
        public string ServerName { get; set; }
        [MaxLength(20)]
        public string ServerIP { get; set; }
        public int JobEnabled { get; set; }

        //FK to the FileMounts table ()
        //public long pcDriveMountId { get; set; }
        //public virtual pcDriveMount pcDriveMount { get; set; }
        //public virtual ICollection<pcDriveMount> DriveMounts { get; set; }
        //public ICollection<pcPlugInValue> PlugInsList { get; set; }
        //virtual = LAZY LOADING (loaded when needed)

        //JobActions holds a list of Schedules
        //public virtual ICollection<pcJobSchedule> JobSchedules { get; set; }
        //public ICollection<pcJobSchedule> JobSchedules { get; set; }

        //FK to the JobTypes table (Delete Files, Verify Backups, Ping, etc)
        //public long pcJobTypeId { get; set; }
        //public virtual pcTypeJob pcJobType { get; set; }

        //--------------------------------------
        //FK to the codes table (to indetify the schedule type: daily, weekly, etc)
        //public long ScheduleTypeId { get; set; }
        //public virtual pcTypeSchedule ScheduleType { get; set; } 
        public string TypeSchedule { get; set; }

        public DateTime StartDate { get; set; }
        public Boolean dayMonday { get; set; }
        public Boolean dayTuesday { get; set; }
        public Boolean dayWednesday { get; set; }
        public Boolean dayThursday { get; set; }
        public Boolean dayFriday { get; set; }
        public Boolean daySaturday { get; set; }
        public Boolean daySunday { get; set; }
        public Boolean RunNow { get; set; }
        public DateTime EndDate { get; set; }
        public int DateOfMonth { get; set; }
        //public int DayOfWeek { get; set; }
        public DateTime ScheduleHour { get; set; }
        public int EveryHowMany { get; set; }

        public DateTime RunTimeLast { get; set; }
        public DateTime RunTimeNext { get; set; }

        //--------------------------------------

        //IVersionTracking
        public DateTime DateCreated { get; set; }
        public DateTime LastUpdated { get; set; }
        [Timestamp]
        public byte[] Version { get; set; }
    }
}
